home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
hc
/
xcmd_eff.sit
/
Effect XCMD
/
card_4903.txt
< prev
next >
Wrap
Text File
|
1988-01-25
|
4KB
|
148 lines
-- card: 4903 from stack: in
-- bmap block id: 0
-- flags: 4000
-- background id: 2583
-- name:
----- HyperTalk script -----
on opencard
set the scroll of card field 1 to 0
end opencard
-- part 1 (field)
-- low flags: 01
-- high flags: 0007
-- rect: left=7 top=114 right=332 bottom=504
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: source code
----- HyperTalk script -----
on mousedown
answer "Sorry, it's lockedΓÇö FOR YOUR PROTECTION!"
end mousedown
-- part 2 (button)
-- low flags: 00
-- high flags: A002
-- rect: left=392 top=86 right=106 bottom=504
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: Copy to clipboard
----- HyperTalk script -----
on mouseUp
set the locktext of card field 1 to false
get the rect of card field 1
set the scroll of card field 1 to 10000
click at (item 1 of it + 2),(item 4 of it - 4)
set the scroll of card field 1 to 0
click at (item 1 of it+2),(item 2 of it + 4) with shiftkey
type "c" with commandkey
click at (item 1 of it + 2),(item 2 of it + 4) -- deselect
click at -1,-1 -- remove blinking bar
set the locktext of card field 1 to true
end mouseUp
-- part 3 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=7 top=86 right=107 bottom=387
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 14
-- style flags: 16640
-- line height: 18
-- part name:
-- part contents for card part 1
----- text -----
{$R-}
(* SOURCE CODE "Effect.p" 1/19/88
Effect -- a routine to execute hypertalk in a field. Copyright © 1988 by Dan Wood.
This source code is provided to the public for educational purposes. It is not supported.
Please don't laugh at my Pascal! At least it works! (I think.)
Are you happy, Scott? Here's some real source code! No need to fear…
Raines, this should serve as inspiration to you.
*** I encourage all XCMD writers to put some of their source code into the public view,
*** as it is very helpful to see what others are doing and how they are doing it!
To compile in MPW Pascal, use the following two lines (replace "MyStack" with your stack name)
pascal Effect.p
link -m ENTRYPOINT -o MyStack -rt XCMD=401 -sn Main=Effect Effect.p.o Γêé
"{MPW}"Libraries:Interface.o "{MPW}"PLibraries:PasLib.o
*)
{$S Effect } { Segment name must be the same as the command name. }
UNIT DummyUnit;
INTERFACE
USES MemTypes, QuickDraw, OSIntf, ToolIntf, HyperXCmd;
PROCEDURE EntryPoint(paramPtr: XCmdPtr);
IMPLEMENTATION
TYPE
Str31 = String[31];
PROCEDURE Effect(paramPtr: XCmdPtr); FORWARD;
VAR
Str:Str255;
ScanPtr: Ptr;
theZeroStr: Handle;
PROCEDURE EntryPoint(paramPtr: XCmdPtr);
BEGIN
Effect(paramPtr);
END;
PROCEDURE Effect(paramPtr: XCmdPtr);
{$I XCmdGlue.inc }
BEGIN
theZeroStr:=paramPtr^.params[1]; { this is the effect name }
ReturnToPas(TheZeroStr^,Str);
theZeroStr := EvalExpr(concat('card field "',Str,'" of card "Effects Card"'));
{ now we have the text to run as hypertalk }
HLock(theZeroStr);
ScanPtr := theZeroStr^;
WHILE ScanPtr^ <> 0 do BEGIN
while ScanPtr^ = ord(' ') do BEGIN
ScanPtr := Ptr(LongInt(ScanPtr)+1); { and skip the space }
END; { while }
{ now leading blanks skipped }
ReturnToPas(ScanPtr,str);
ScanToReturn(ScanPtr); { bump up pointer }
if (ord(str[1]) <> ord('-')) and (ord(str[2]) <> ord('-'))
then SendCardMessage(str);
while ScanPtr^ = 13 do BEGIN
ScanPtr := Ptr(LongInt(ScanPtr)+1); { and skip the CR }
END; { while }
END;
DisposHandle(theZeroStr); { Done with source string }
END;
END.
-- part contents for card part 3
----- text -----
Source code for ΓÇ£EffectΓÇ¥